#lambda匿名函数
#   lambda表达式: lambda  参数:功能+返回的东西
a=lambda x:x+1 # def b(n):
print(a(6))        # return n+1

print(list(map(lambda x:x+1,[1,2,3,4,5,6,7,8])))
print(list(map(lambda x:x>1,[1,2,3,4,5,6,7,8])))
print(list(filter(lambda x:x>3,[1,2,3,4,5,6,7,8])))
print(map(lambda x:x+1,[1,2,3,4,5,6,7,8]))#打印地址
for i in [1,2,3,4,5]:
    pass
print(i)


def a():
    n=1
    def b():

        global m
        m=2
    def c():
        o=3
        print(n,m,o)
    b()
    c()

a()
##闭包
def outer_func():
    local_list=[]
    print(local_list)
    def inner_func(name):
        local_list.append(len(local_list)+1)
        print(local_list)
        print ('%s local_list=%s'%(name,local_list))
    return inner_func
clo_func_0 = outer_func()
clo_func_0('clo_func_0')
clo_func_0('clo_func_0')
outer_func()('clo_func_1')
#######递归
def f():
    a=1
    f()

f()
